package org.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.bean.Category;
import org.example.mapper.CategoryMapper;
import org.example.service.CategoryService;
import org.example.util.JsonResult;
import org.example.util.ResultTool;
import org.springframework.stereotype.Service;

@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {
    @Override
    public JsonResult find() {
        QueryWrapper<Category> wrapper = new QueryWrapper<>();
        wrapper.last("limit 8");
        return ResultTool.success(list(wrapper));
    }
}
